{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>详情</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">投诉账号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_phone" lay-verify="required" value="{$info.user_phone}" class="layui-input" disabled>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">投诉内容：</label>
                            <div class="layui-input-block">
                                <textarea name="complain_content" lay-verify="required" class="layui-input " style="height:80px" disabled>{$info.complain_content}</textarea>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="form-group">
                                <label class="layui-form-label">投诉图片：</label>
                                {if(!empty($info.complain_img))}

                                <div class="input-group col-sm-4">
                                    <ul id="view_{$info.complain_id}" class="class_view">
                                        {foreach name='info.complain_img' item='vo' key='k'}
                                        <li><img src="{$vo}" height="80px" width="80px" style="float:left;margin-left: 50px;margin-top:5px;cursor:pointer;"></li>
                                        {/foreach}
                                    </ul>
                                    <!--{volist name='info.complain_img' id='vo'}-->
                                    <!--<img id="complain_img" class="class_view" height="80px" width="80px" style="float:left;margin-left: 50px;margin-top:5px;cursor:pointer;"-->
                                         <!--src="{$vo}"/>-->
                                    <!--{/volist}-->
                                </div>
                                {else /}
                                暂无图片
                                {/if}
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">投诉状态：</label>
                            <div class="layui-input-block">
                                <input type="text" name="status" lay-verify="required" value="{$info.status}" class="layui-input" disabled>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">投诉时间：</label>
                            <div class="layui-input-block">
                                <input type="text" name="complain_time" lay-verify="required" value="{$info.complain_time}" class="layui-input" disabled>
                            </div>
                        </div>

                        {if $info.complain_status == 1}
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">处理/忽略：</label>
                            <button class="layui-btn" id="done">处理
                            </button>
                            <button class="layui-btn" id="past">忽略
                            </button>
                        </div>

                        {/if}

                        <input type="hidden" name="complain_id" value="{$complain_id}">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    var complain_id = $("input[name='complain_id']").val();
    $('.class_view').viewer();
    //处理
    $('#done').click(function () {
        if(confirm('确定要处理这条信息吗？')){
            $.ajax({
                url:"{:url('complainDone')}",
                type:'post',
                dataType:'json',
                data:'id=' + complain_id,
                success:function (res) {
                    if(res.code == 200){
                        layer.msg(res.msg,{icon:1,time:1500,shade: 0.1},function(){
                            window.location.reload();
                        });
                    } else if (res.code == 100){
                        layer.msg(res.msg,{icon:2,time:1500,shade: 0.1});
                    }
                }
            })
        }
    });

    //忽略
    $('#past').click(function () {
        if(confirm('确定要忽略这条信息吗？')){
            $.ajax({
                url:"{:url('complainPast')}",
                type:'post',
                dataTpye:'json',
                data:'id=' + complain_id,
                success:function (res) {
                    if(res.code == 200){
                        layer.msg(res.msg, {icon:1, time:1500, shade:0.1}, function () {
                            window.location.reload();
                        });
                    }else {
                        layer.msg(res.msg, {icon:2, time:1500, shade:0.1});
                    }
                }
            })
        }
    })
</script>

</body>
</html>
